package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class Add implements IOPeration{
    public void work(BookList bookList) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入书名:");
        String name = sc.nextLine();
        System.out.print("请输入作者:");
        String author = sc.nextLine();
        System.out.print("请输入价格:");
        int price = sc.nextInt();
        System.out.print("请输入类型:");
        String type = sc.nextLine();
        Book book = new Book(name,author,price,type);
        bookList.setBooklist(book);
        bookList.setBookNum(bookList.getBookNum()+1);
    }
}

